//第一种数据格式，单列 type=1
			var one = [
				{
					name:'周一',
					value:'Monday'
				},
				{
					name:'周二',
					value:'Tuesday'
				},
				{
					name:'周三',
					value:'Wednesday'
				},
				{
					name:'周四',
					value:'Thursday'
				},
				{
					name:'周五',
					value:'Friday'
				},
				{
					name:'周六',
					value:'Saturday'
				},
				{
					name:'周日',
					value:'Sunday'
				}
				
			];
			//第2种数据格式，二级联动的 type=2
			var two = [
				{
					name:'今天',
					value:'today',
					child:[
						{name:'8:00',value:'8'},
						{name:'9:00',value:'9'},
						{name:'10:00',value:'11'},
						{name:'12:00',value:'12'}
					]
				},
				{
					name:'明天',
					value:'tomorrow',
					child:[
						{name:'8:00',value:'8'},
						{name:'9:00',value:'9'},
						{name:'10:00',value:'11'},
						{name:'12:00',value:'12'}
					]
				},
				{
					name:'后天',
					value:'after',
					child:[
						{name:'8:00',value:'8'},
						{name:'9:00',value:'9'},
						{name:'10:00',value:'11'},
						{name:'12:00',value:'12'}
					]
				}
			];
			//第三种数据格式，2级，但不联动 type=3
			var three = {
				parent:[
					{
						name:'今天',
						value:'tody'
					},
					{
						name:'明天',
						value:'tomorrow'
					},
					{
						name:'后天',
						value:'afer'
					},
					{
						name:'大后天',
						value:'daht'
					}
				],
				child:[
						{name:'8:00',value:'8'},
						{name:'9:00',value:'9'},
						{name:'10:00',value:'11'},
						{name:'12:00',value:'12'}
				]
			};
			//第四种数据格式，3级，联动 type=4
			var four = [ 
				{
					name:'1',
					value:'1',
					child:[
						{
							name:'11',
							value:'11',
							child:[
								{name:'111',value:'111'},
								{name:'112',value:'112'},
								{name:'113',value:'113'},
							]
						},
						{
							name:'12',
							value:'12',
							child:[
								{name:'121',value:'121'},
								{name:'122',value:'122'},
								{name:'123',value:'123'},
							]
						},
						{
							name:'13',
							value:'13',
							child:[
								{name:'131',value:'131'},
								{name:'132',value:'132'},
								{name:'133',value:'133'},
							]
						},
					]
				},
				{
					name:'2',
					value:'2',
					child:[
						{
							name:'21',
							value:'21',
							child:[
								{name:'211',value:'211'},
								{name:'221',value:'221'},
								{name:'231',value:'231'},
							]
						},
						{
							name:'22',
							value:'22',
							child:[
								{name:'221',value:'221'},
								{name:'222',value:'222'},
								{name:'223',value:'223'},
							]
						},
						{
							name:'23',
							value:'23',
							child:[
								{name:'231',value:'231'},
								{name:'232',value:'232'},
								{name:'233',value:'233'},
							]
						},
					]
				},
				{
					name:'3',
					value:'3',
					child:[
						{
							name:'31',
							value:'31',
							child:[
								{name:'311',value:'311'},
								{name:'312',value:'312'},
								{name:'313',value:'313'},
							]
						},
						{
							name:'32',
							value:'32',
							child:[
								{name:'321',value:'321'},
								{name:'322',value:'322'},
								{name:'323',value:'323'},
							]
						},
						{
							name:'33',
							value:'33',
							child:[
								{name:'331',value:'331'},
								{name:'332',value:'332'},
								{name:'333',value:'333'},
							]
						},
					]
				}
			];
document.addEventListener('DOMContentLoaded',function(){
	addListener();
},false);
function addListener(){
	document.getElementById('demo-con').addEventListener('click',function(ev){
		var targetId = ev.target.id;
		var listData = null;
		var type = 0;
		if(targetId == 'type1'){
			listData = one;
			type = 1;
		}else if(targetId == 'type2'){
			listData = two;
			type = 2;
		}else if(targetId == 'type3'){
			listData = three;
			type = 3;
		}else if(targetId == 'type4'){
			listData = four;
			type = 4;
		};
			var p = new lcPicker(listData,{
				target:'date-picker',//选择器id，此节点可以存在也可以不存在
				type:type,
				title:'测试数据',
				name:'name',//配置节点的节点name 默认是name
				value:'value',//配置节点的节点value，默认是value
				child:'child',//配置节点的子节点,默认是child
				parent:'parent',//针对不联动的
				okEvent:function(data){
					console.log(data);
					var l1 = document.getElementById('level1');
					var l2 = document.getElementById('level2');
					var l3 = document.getElementById('level3');
					l1.innerHTML = 'name:'+data.pName + ' value:'+data.pValue;
					if(data.cName){
						l2.innerHTML = 'name:'+data.cName + ' value:'+data.cValue;
					};
					if(data.gName){
						l3.innerHTML = 'name:'+data.gName + ' value:'+data.gValue;
					};
					p = null;
				},
				cancelEvent:function(){
					p = null;
				}
			});
	},false);
};
